import http from "@/utils/request";

export async function createRefund(data: object): Promise<API.Result> {
    /** 创建退款 */
    return http.post("refund", data);
}

// 获取退款列表
export async function getRefunds(status?: number, current: number = 1, pageSize: number = 10): Promise<API.Result> {
    return http.get("refund", {params: {status, current, pageSize}});
}

// 确定 退款 或拒绝退款
export async function refundHandle(refund_id: number, status: number): Promise<API.Result> {
    return http.post(`refund/handle`, {refund_id, status});
}

// 获取退款订单详情
export async function getRefundDetail(refundId: string): Promise<API.Result> {
    return http.get(`refund/${refundId}`);
}
